// 样品检测

import request from '@/utils/request'

// 立即检测
export function saveDetection(params) {
  return request({
    url: 'report/report.do?action=save',
    method: 'post',
    params
  })
}

// 获取检测详情
export function getDetails(id) {
  return request({
    url: `/report/report.do?action=get&id=${id}&buildControls=REPORT_DETAIL_BUILD_FAST_CHECK_PRODUCT`,
    method: 'post'
  })
}

// 检测人员列表
export function getPerson() {
  return request({
    url: '/baseTrace/employee.do?action=list&roleCodeIn=manager,inspector,samplerAndInspector&enabled=true&type=fastCheckPerson',
    method: 'post'
  })
}

// 快检产品
export function getProduct(params) {
  return request({
    url: '/farmFastCheck/bill.do?action=farmFastCheckBillPage&dataSource=fastCheckProduct',
    method: 'post',
    params
  })
}

// 获取区域/快检点
export function getArea(params) {
  return request({
    url: '/baseTrace/warehouseInfo.do?action=list',
    method: 'post',
    params
  })
}

// 快检产品
export function getEquipment() {
  return request({
    url: '/baseTrace/equipment.do?action=list&enabled=true&limit=30',
    method: 'post'
  })
}

// 获取检测项目
export function getProject() {
  return request({
    url: '/baseTrace/sampleProject.do?action=list&varietyName=&enabled=true',
    method: 'post'
  })
}
